package com.nexus.all.vo;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.nexus.all.model.NoteContent;
import com.nexus.all.model.User;
import com.nexus.bean.convertor.LongJsonDeserializer;
import com.nexus.bean.convertor.LongJsonSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDateTime;

/**
 * @ClassName: NoteDTO
 * @Author: ZZYR
 * @Date: 2024/2/26  9:21
 * @Version 1.0.0
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@ApiModel("笔记出参")
public class NoteVO {

    @JsonSerialize(using = LongJsonSerializer.class)
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @ApiModelProperty("id")
    private Long id;

    /**
     * 标题
     */
    @ApiModelProperty("标题")
    private String title;

    /**
     * 发布用户id
     */
    @JsonSerialize(using = LongJsonSerializer.class)
    @JsonDeserialize(using = LongJsonDeserializer.class)
    @ApiModelProperty("用户id")
    private Long userId;

    /**
     * 笔记封面图片url
     */
    @ApiModelProperty("封面图片url")
    private String coverUrl;

    @ApiModelProperty("用户昵称")
    private String nickName;

    @ApiModelProperty("用户头像url")
    private String avatarUrl;

    @ApiModelProperty("笔记内容对象")
    private NoteContent notecontent;

    @ApiModelProperty("用户对象")
    private UserVO userVO;

    @ApiModelProperty("点赞数量")
    private Integer likeCount;

    @ApiModelProperty("评论数量")
    private Integer commentCount;

    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty("是否已点赞")
    private Boolean isLiked = Boolean.FALSE;
}
